package day20171221;

import com.sun.deploy.net.FailedDownloadException;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Test {


    public static void main(String[] args) {

        Map<String, Integer> map = new HashMap<>();

        String stuNo = "";

        //字符流方式读文件
        String path = "D:\\names.txt";

        BufferedReader reader = null;

        try {
            reader = new BufferedReader(new FileReader(path));

            while ((stuNo = reader.readLine()) != null) {
                map.put(stuNo, 0);

            }
        } catch (FailedDownloadException e) {
            e.printStackTrace();

        } catch (IOException e) {
            e.printStackTrace();

        } finally {
            try {
                reader.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

        File file = new File(path:"C:\\16信本2班Java作业一");

        File[] files;
        files = file.listFiles();
        //遍历
        for (File f : files) {

            String fileName = f.getName();

            //从文件名中提取学号
            //正则表达式：1.模板；2.三个填空
            Matcher matcher = Pattern.compile("").matcher("");
            while (matcher.find()) {
                matcher.group();
            }
        }
    }
}


